
from selenium import webdriver
import time




    # print(strs[0].lstrip(),strs[1].lstrip())
# # browers.get(url)


# def transform_cookies(cookies_str):
#     cookies = []
#     cookies_str_split = cookies_str.split(';')
#     for str in cookies_str_split:
#         strs = str.split('=')
#         cookie = {
#             # 'domain': '.baidu.com',
#             'name': strs[0].lstrip(),
#             'value': strs[1].lstrip(),
#             "expires": "",
#             'path': '/',
#             'httpOnly': False,
#             'HostOnly': False,
#             'Secure': False,
#         }
#         cookies.append(cookie)
#     return cookies


if __name__ == '__main__':
    path = '../chromedriver.exe'

    driver = webdriver.Chrome(path)

    url = 'https://tieba.baidu.com/index.html'
    driver.get(url)
    time.sleep(1)
    driver.find_element_by_css_selector('.tang-pass-footerBarULogin').click()
    driver.find_element_by_css_selector('#TANGRAM__PSP_4__userName').send_keys('15660917807')
    driver.find_element_by_css_selector('#TANGRAM__PSP_4__password').send_keys('cai123cai456')
    driver.find_element_by_css_selector('#TANGRAM__PSP_4__submit').click()
    time.sleep(1)
